<template>
  <div>
    <Contentheader :headerInfo="headerInfo" />

    <!-- 物品数据列表 -->
    <el-card>
      <template>
        <el-table
          :data="goodsList"
          tooltip-effect="dark"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column prop="id" label="ID"> </el-table-column>
          <el-table-column prop="Productname" label="物品名称">
          </el-table-column>
          <el-table-column prop="Productimage" label="物品图片">
          </el-table-column>
          <el-table-column prop="status" label="物品状态">
            <template slot-scope="scope">
              <span v-if="scope.row.status">已领取</span>
              <span v-else>未领取</span>
            </template>
          </el-table-column>
          <el-table-column prop="fbtimer" label="发布时间" width="130px">
          </el-table-column>
          <el-table-column prop="IssueUser" label="发布人"> </el-table-column>
          <el-table-column prop="lqtimer" label="领取时间" width="130px">
          </el-table-column>
          <el-table-column prop="Username" label="领取人"> </el-table-column>
          <el-table-column prop="Phone" label="领取人电话"> </el-table-column>
          <el-table-column label="操作" width="110px">
            <template slot-scope="">
              <el-link type="primary">编辑</el-link>
              <el-link class="btndel" type="danger">删除</el-link>
            </template>
          </el-table-column>
        </el-table>
      </template>
    </el-card>
  </div>
</template>

<script>
import { mapState } from "vuex";
import Contentheader from "@/components/Contentheader";
export default {
  name: "Goodissus",
  data() {
    return {
      // Contentheader组件的数据
      headerInfo: {
        title: "发布物品管理",
        rightInfo: {
          btnName: "新增",
          iptMessage: "请输入物品名称",
        },
      },
      // 获取选中的数据
      multipleSelection: [],
    };
  },
  components: { Contentheader },
  mounted() {
    // 当页面刷新时发送请求获取数据
    this.$store.dispatch("goodissus/getGoodsLists");
    //this.getGoodsList();
  },
  computed: {
    ...mapState("goodissus", ["goodsList"]),
  },
  methods: {
    //全选按钮
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
  },
};
</script>

<style lang="less" scoped>
.el-card {
  margin-top: 20px;
  .btndel {
    margin-left: 10px;
  }
}
</style>
